<!DOCTYPE html>
<html>
<head>
   <title>CSS Animations - animation-duration: 0s, fill forwards</title>
   <link rel="author" title="Opera Software ASA" href="http://www.opera.com/">
   <link rel="help" href="http://dev.w3.org/csswg/css3-animations/#the-animation-duration-property-">
   <meta name="flags" content="dom">
   <meta name="assert" content="An animation that fills forwards will retain
   the value specified at the 100% keyframe, even if the animation was
   instantaneous">
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
   <style type="text/css">
      @keyframes shrink {
         from {
            width: 200px;
         }
         to {
            width: 100px;
         }
      }
      div {
         width: 200px;
         height: 100px;
         background: blue;
      }
      .test {
         animation-name: shrink;
         animation-fill-mode: forwards;
         animation-duration: 0s;
      }
   </style>
   <script type="text/javascript">
      setup({explicit_done:true});
      onload = function() {
         var testName = document.querySelector('title').firstChild.data;
         var div = document.querySelector('div');
         var log = document.querySelectorAll('p')[1].firstChild;
         div.className = 'test';
         var passed = (getComputedStyle(div, null).width == '100px');
         test(function(){assert_true(passed);}, testName); done();
         log.data = (passed ? 'PASS if there is a blue square.' : 'FAIL');
      }
   </script>
   <style>iframe{display:none}</style>
</head>
<body>
   <p>The blue block below should have a square shape.</p>
   <p>Testing...</p>
   <div></div>
</body>
</html>
